<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<body>

<div class="ck_nr" th:fragment="deposit">
    <link rel="stylesheet" type="text/css" href="css/center.css"/>
    <div class="as_fl20">
        <h3 class="as_fl20_h3">选择存款方式:</h3>
        <div class="as_cn">
            <div th:class="${iterStat.first}?'as_triangle_down zx_icon':'as_triangle_down'"  id="setting_fastpay_icon" th:each="item,iterStat:${list}">
                <a id="setting_fastpay_bt" class="as_info" th:text="${item.depositname}"></a>
            </div>
            <input type="hidden" value="third" id="paymentType">
        </div>
    </div>
    <div class="as_fr80">

        <div id="deposit_from" class="deposit_not_available" th:style="${iterStat.first}?'display:block;text-align: left;':'display:none;text-align: left;'"  th:each="item,iterStat:${list}">
            <form id="depositFrom">
                <div class="fastpay_box">
                    <div class="tk_jr fl"><span class="text fs14"><b style="color:#000;">存款金额：</b></span><span
                            class="input">
                  <input name="depositMoney" type="text" id="depositMoney" placeholder="金额" value=""
                         class="r_inptut inputwd300" onkeyup="amount(this)" onblur="overFormat(this)" maxlength="8">
                  </span></div>

                    <div class="tk_ts m20b">
                        <span id="depositMoney_tips" class="text">
                            <img style="margin:0px; margin-right:10px;" src="images/ico24.png">存款金额 <span th:text="${item.minDepositAmount}" >100</span> 到 <span th:text="${item.maxDepositAmount}"></span></span>
                    </div>
                    <div class="tk_num clear m20t"><span><b>100</b><b>500</b><b>1000</b><b>2000</b></span></div>

                    <div id="bankSelectRow" class="tk_yh deposit_atmsel_icon"><span class="text fs14"><b
                            style="color:#000;">选择银行：</b></span> <span class="radio">
                  <label class="on">
                    <input checked="" type="radio" name="bankCode" value="ICBC">
                    <b><i class="deposit_atmsel_icon_i ICBC"><img></i>工商银行</b></label>
                  <label>
                    <input type="radio" name="bankCode" value="CCB">
                    <b><i class="deposit_atmsel_icon_i CCB"><img></i>建设银行</b></label>
                  <label>
                    <input type="radio" name="bankCode" value="ABC">
                    <b><i class="deposit_atmsel_icon_i ABC"><img></i>农业银行</b></label>
                  <label>
                    <input type="radio" name="bankCode" value="BOC">
                    <b><i class="deposit_atmsel_icon_i BOC"><img></i>中国银行</b></label>
                  <label>
                    <input type="radio" name="bankCode" value="POST">
                    <b><i class="deposit_atmsel_icon_i POST"><img></i>中国邮政</b></label>
                  <span class="otherbank">
                  <label>
                    <input type="radio" name="bankCode" value="CMBC">
                    <b><i class="deposit_atmsel_icon_i CMBC"><img></i>招商银行</b></label>
                  <label>
                    <input type="radio" name="bankCode" value="PINGAN">
                    <b><i class="deposit_atmsel_icon_i PINGAN"><img></i>平安银行</b></label>
                  <label>
                    <input type="radio" name="bankCode" value="BOCO">
                    <b><i class="deposit_atmsel_icon_i BOCO"><img></i>交通银行</b></label>
                  <label>
                    <input type="radio" name="bankCode" value="CMSB">
                    <b><i class="deposit_atmsel_icon_i CMSB"><img></i>民生银行</b></label>
                  <label>
                    <input type="radio" name="bankCode" value="CEBB">
                    <b><i class="deposit_atmsel_icon_i CEBB"><img></i>光大银行</b></label>
                  <label>
                    <input type="radio" name="bankCode" value="ECITIC">
                    <b><i class="deposit_atmsel_icon_i ECITIC"><img></i>中信银行</b></label>
                  <label>
                    <input type="radio" name="bankCode" value="CIB">
                    <b><i class="deposit_atmsel_icon_i CIB"><img></i>兴业银行</b></label>
                  <label>
                    <input type="radio" name="bankCode" value="GDB">
                    <b><i class="deposit_atmsel_icon_i GDB"><img></i>广发银行</b></label>
                    <label>
                    <input type="radio" name="bankCode" value="GDB">
                    <b><i class="deposit_atmsel_icon_i GDB"><img></i>广发银行</b></label>
                    <label>
                    <input type="radio" name="bankCode" value="GDB">
                    <b><i class="deposit_atmsel_icon_i GDB"><img></i>广发银行</b></label>
                           <label>
                    <input type="radio" name="bankCode" value="GDB">
                    <b><i class="deposit_atmsel_icon_i GDB"><img></i>广发银行</b></label>
                           <label>
                    <input type="radio" name="bankCode" value="GDB">
                    <b><i class="deposit_atmsel_icon_i GDB"><img></i>广发银行</b></label>
                           <label>
                    <input type="radio" name="bankCode" value="GDB">
                    <b><i class="deposit_atmsel_icon_i GDB"><img></i>广发银行</b></label>

                  <label>
                    <input type="radio" name="bankCode" value="HXB">
                    <b><i class="deposit_atmsel_icon_i HXB"><img></i>华夏银行</b></label>
                  </span> </span></div>
                    <input th:value="${item.id}" hidden name="depositChannelId" />
                    <b class="morebank" data="hide" id="morebank"></b>
                    <div style="margin:0 auto">
                        <button type="button" style="margin-left:400px;" id="deposit_bt" class="as_but inputwd300">
                            立即存款
                        </button>
                    </div>
                </div>
            </form>
        </div>



    </div>

    <script>
        $('.as_cn .as_triangle_down').click(function () {
            $(this).addClass('zx_icon').siblings().removeClass('zx_icon');
            $('.as_fr80 .deposit_not_available').eq($(this).index()).siblings().hide().end().show();

        })


        $(".fastpay_box").find("b").click(function () {
            var amountMoney = $(this).text();
            $(this).parent().parent().parent().find("input[class='r_inptut inputwd300']").val(amountMoney);

        })

        $("button[class='as_but inputwd300']").click(function () {
            var parentObj = $(this).parent().parent();
            var inputObj = $(this).parent().parent().find("input[class='r_inptut inputwd300']");
            if (inputObj.val().length == 0) {
                alertWorning('请输入你的存款金额!');
                return;
            }

            $.ajax({
                method: "POST",
                url: "/addDepositOrder",
                data: $("#depositFrom").serializeArray(),
                dataType: 'json'
            }).done(function (data) {
                if (data.status == 'success') {
                    //window.location.href = '/deposit';
                    alertGood(data.data);
                } else {
                    alertWorning(data.data);
                }
            });
        })


        $(".radio label").click(function () {
            //  $(".radio label").find('input').attr("checked", false);
            $(this).find('input').attr("checked", 'checked').parent().siblings().find('input').attr("checked", false);
            $(this).siblings().removeClass("on");
            $(".radio label").removeClass("on");
            $(this).addClass('on');
        });

        $("#morebank").click(function () {
            $(".otherbank").slideToggle("slow");
            var data = $("#morebank").attr("data");
            if (data == 'hide') {
                $(this).attr('style', 'background-image: url(images/souqi.png);');
                $("#morebank").attr("data", "show");
            } else {
                $(this).attr('style', 'background-image: url(images/hyw06.jpg);');
                $("#morebank").attr("data", "hide");
            }

        });


    </script>

</div>

</body>

</html>


